﻿<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
	<meta charset="utf-8" />
</head>
<body>
    <script src="Scripts/jquery-1.10.2.min.js"></script>
   

    <script type="text/javascript">
        (function ($) {
            $.getUrlParam = function (name) {
                var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
                var r = window.location.search.substr(1).match(reg);
                if (r != null) return unescape(r[2]); return null;
            }
        })(jQuery);
        $(function () {
            var host = $.getUrlParam('host');
            var testHost = "http://47.90.73.137:8089/";
            if (host)
                getContract(host);
            else
                getContract(testHost);
        });

        function getContract(apiHost) {
            var URL = apiHost + "iGetData.ashx";            var data = {
                "ClientVersion": "1.0",
                "ActionType": "getcontractdata",
                "data": "{ \"ContractGUID\": null }"
            };

            $.post(URL, { bgdata: JSON.stringify(data) }, function (result) {
                result = JSON.parse(result);

                if (result.ActionStatus === "1") {
                    var details = JSON.parse(result.Result);
                    window.androidShare.jsMethod(result.Result);
                }
            });
        }
    </script>
</body>
</html>
